#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include <QNetworkAccessManager>
#include <QNetworkReply>

#include <QTimer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_pushButton_clicked();

    void onNetworkReply(QNetworkReply *reply);

private:
    Ui::MainWindow *ui;
    QNetworkAccessManager *networkManager;
    QTimer *exchangeRateTimer;

    void setupUI();
    void appendLog(const QString &message);
    void fetchExchangeRate();
    void checkAndNotifyExchangeRate(double rate);
    void sendBarkNotification(const QString &message, bool withSound = false);
};

#endif // MAINWINDOW_H
